<?php
/**
 * Pertyler DatabaseManagement
 * Control
 * Moderator
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pertyler;

require_once __DIR__ . '/main.php';

require_once __DIR__ . '/../databaseModel/Role.php';

if(!($moderator = Role_Moderator::Select()))
	return require __DIR__ . '/Index.php';

if(isset($_POST['ChangePassword']))
	return require __DIR__ . '/ChangePassword.php';

if(isset($_POST['Logout']))
	return require __DIR__ . '/Logout.php';

$Content = \Pert\Page::Get()->Content();

$Content->ModeratorName = (string) $moderator;

unset($moderator);

echo \Pert\Page::Get()->HeaderHTML();

require __DIR__ . '/../view/Moderator.php';

echo \Pert\Page::Get()->FooterHTML();

return true;
